<?php

namespace app\common\model;

use think\Model;

class Area extends Model
{

    public function get_area($province_id,$city_id,$area_id,$address='')
    {
        $province=model("Area")->where(['id'=>$province_id])->value('title');
        $city=model("Area")->where(['id'=>$city_id])->value('title');
        $area=model("Area")->where(['id'=>$area_id])->value('title');
        $province_title=isset($province)?$province:'';
        $city_title=isset($city)?$city:'';
        $area_title=isset($area)?$area:'';
        $str=$province_title.$city_title.$area_title.$address;
        return $str;
    }


    public function area_data($city_id,$area_id,$address='')
    {
        $city=model("Area")->where(['id'=>$city_id])->value('title');
        $area=model("Area")->where(['id'=>$area_id])->value('title');
        $city_title=isset($city)?$city:'';
        $area_title=isset($area)?$area:'';
        $str=$city_title.$area_title.$address;
        return $str;
    }

}
